<?php
/**
*
* @package ppkBB3cker
* @version $Id: posting_addfields_add3.php 1.000 2009-08-25 19:22:00 PPK $
* @copyright (c) 2009 PPK
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
	exit;
}

if($is_submitted)
{
	if(!$error && !$addfields_error && $addfields_sqls)
	{
		$post_id ? '' : $post_id=$data['post_id'];
		$topic_id ? '' : $topic_id=$data['topic_id'];
		$result=$db->sql_query("DELETE FROM ".TRACKER_ADDFIELDS_TABLE." WHERE post_msg_id='{$post_id}'");
		foreach($addfields_sqls as $v)
		{
			$v=sprintf($v, $post_id, $topic_id);
			$v=str_replace('%%', '%', $v);
			$result=$db->sql_query($v);
		}
	}
}
?>
